<template>
  <div class="container">
    <el-card shadow="always">
      <div class="list">
        <div class="item" v-for="item in list" :key="item.id">
          <div class="title">
            {{ item.publicityYear+'年第'+item.num+'次公示信息'}}
          </div>
          <el-image
            v-for="items in item.imgList"
            :key="items.fileUrl"
            style="width: 150px; height: 150px"
            :src="items.fileUrl"
            fit="fill"
            :preview-src-list="item.imgList.map(x=>x.fileUrl)"
          ></el-image>
        </div>
      </div>
      <el-empty description="暂无数据" v-if="!list.length"></el-empty>
    </el-card>
  </div>
</template>
<script>
import { publicityFindListByCondition } from "@/api/modules/workstation";
export default {
  // props:[],
  // 页面加载
  created() {
    this.getList();
  },
  // 页面加载完成
  mounted() {},
  //实例销毁之前
  beforeDestroy() {},
  //实例销毁后
  destroyed() {},
  data() {
    return {
      list: [],
    };
  },
  // 方法
  methods: {
    getList() {
      publicityFindListByCondition({
        endPublicityDate: "",
        isPage: 1,
        page: 1,
        pageSize: 10,
        publicityNumber: "",
        publicityYear: new Date().getFullYear(),
        searchValue: "",
        startPublicityDate: "",
        workStationId: sessionStorage.getItem("workId"),
      }).then((res) => {
        //   console.log(res);
        // res.data.forEach((item) => {
        //   item.fileList = [];
        //   item.URLList = [];
        // //   item.urlList.forEach((x) => {
        // //     if (x.match(/[^\.]\w*$/)[0] !== "pdf") {
        // //       item.URLList.push(x);
        // //     } else {
        // //       item.fileList.push(x);
        // //     }
        // //   });
        // });
        this.list = res.data;
      });
    },
  },
  // 监听属性
  watch: {},
  // 组件
  components: {},
  // 计算属性
  computed: {},
};
</script>

<style lang="scss" scoped>
.container {
  .title {
    padding: 10px 0;
    font-size: $title;
  }
  .enclosure {
    color: $default;
    cursor: pointer;
    font-size: 16px;
  }
  /deep/ .el-image {
    margin-right: 10px;
  }
}
</style>
